/* ========== 全局基础变量 ========== */
:root {
  --bg-color: #f5f5f5;
  --text-color: #222;
  --header-bg: #fff;
  --sider-bg: #fff;
  --table-bg: #fff;
  --primary-color: #1677ff;
  --border-color: #e5e5e5;
  --table-header-bg: #f5f5f5;
  --table-header-color: #333;
  --table-header-hover-bg: #e6f7ff;
  --table-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --table-border-color: #e5e5e5;
}
[data-theme="dark"] {
  --bg-color: #001529;
  --text-color: #fff;
  --header-bg: #001529;
  --sider-bg: #001529;
  --table-bg: #001529;
  --primary-color: #1677ff;
  --border-color: #222;
  --table-header-bg: #141414;
  --table-header-color: #fff;
  --table-header-hover-bg: #177ddc;
  --table-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --table-border-color: #303030;
}
[data-theme="light"] {
  --bg-color: #f5f5f5;
  --text-color: #222;
  --header-bg: #fff;
  --sider-bg: #fff;
  --table-bg: #fff;
  --primary-color: #1677ff;
  --border-color: #e5e5e5;
  --table-header-bg: #f5f5f5;
  --table-header-color: #333;
  --table-header-hover-bg: #e6f7ff;
  --table-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --table-border-color: #e5e5e5;
}

/* ========== 全局基础样式 ========== */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body,
.ant-layout-header,
.ant-layout-sider,
.ant-table,
.ant-table-content,
.ant-table-thead > tr > th,
.ant-table-tbody > tr > td,
.ant-pagination,
.ant-pagination-item,
.ant-pagination-options {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
body {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ========== 侧边栏、菜单、头部 ========== */
.ant-layout-header {
  background: var(--header-bg) !important;
}
.ant-layout-sider {
  background: var(--sider-bg) !important;
}
.ant-menu,
.ant-menu-root,
.ant-menu-dark,
.ant-menu-light {
  background: var(--sider-bg) !important;
  color: var(--text-color) !important;
  transition: background 0.3s, color 0.3s;
}

/* ========== 表格 ========== */
.ant-table, .ant-table-content, .ant-table-tbody > tr > td {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  transition: all 0.3s ease !important;
}

/* 表格标题样式 */
.ant-table-thead > tr > th {
  background: var(--table-header-bg) !important;
  color: var(--table-header-color) !important;
  border-color: var(--table-border-color) !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

/* 表格标题悬停效果 */
.ant-table-thead > tr > th:hover {
  background: var(--table-header-hover-bg) !important;
}

/* 表格行悬停效果 */
.ant-table-tbody > tr:hover > td {
  background: var(--table-header-hover-bg) !important;
}

/* 表格边框和阴影 */
.ant-table {
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: var(--table-shadow) !important;
}

/* ========== 分页器 ========== */
[data-theme="dark"] .ant-pagination {
  background: #001529 !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0002;
  padding: 8px 0;
}
[data-theme="light"] .ant-pagination {
  background: #fff !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  padding: 8px 0;
}
[data-theme="dark"] .ant-pagination-item,
[data-theme="dark"] .ant-pagination-prev,
[data-theme="dark"] .ant-pagination-next,
[data-theme="dark"] .ant-pagination-jump-prev,
[data-theme="dark"] .ant-pagination-jump-next,
[data-theme="dark"] .ant-pagination-item-link {
  background: #fff !important;
  color: #222 !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .ant-pagination-item-active {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}
[data-theme="dark"] .ant-pagination-item:active,
[data-theme="dark"] .ant-pagination-item:focus,
[data-theme="dark"] .ant-pagination-prev:active,
[data-theme="dark"] .ant-pagination-next:active,
[data-theme="dark"] .ant-pagination-jump-prev:active,
[data-theme="dark"] .ant-pagination-jump-next:active,
[data-theme="dark"] .ant-pagination-item-link:active,
[data-theme="dark"] .ant-pagination-item:focus-visible {
  background: var(--primary-color) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px #1677ff33 !important;
  border-color: var(--primary-color) !important;
}
[data-theme="dark"] .ant-pagination-item:hover,
[data-theme="dark"] .ant-pagination-prev:hover,
[data-theme="dark"] .ant-pagination-next:hover,
[data-theme="dark"] .ant-pagination-jump-prev:hover,
[data-theme="dark"] .ant-pagination-jump-next:hover,
[data-theme="dark"] .ant-pagination-item-link:hover {
  border-color: #1677ff !important;
  color: #1677ff !important;
}

/* ========== 分页器下拉、输入框、Select等 ========== */
.ant-pagination-options .ant-select-selector {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}
.ant-pagination-options .ant-select-arrow {
  color: var(--text-color) !important;
}
.ant-input, .ant-select-selector {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.ant-input::placeholder, .ant-select-selection-placeholder {
  color: #aaa !important;
  opacity: 1;
}
.ant-input[disabled], .ant-select-disabled .ant-select-selector {
  background: #222 !important;
  color: #888 !important;
}
.ant-select-dropdown {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
}
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
  background: #1677ff !important;
  color: #fff !important;
}
.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
  background: #0958d9 !important;
  color: #fff !important;
}

/* ========== 右上角语言选择下拉框在暗黑下为白色 ========== */
[data-theme="dark"] .ant-select-dropdown {
  background: #fff !important;
}
[data-theme="dark"] .ant-select-dropdown .ant-select-item-option-content {
  color: #222 !important;
}

/* ========== 输入框在暗黑下依然为白色 ========== */
[data-theme="dark"] .ant-input, [data-theme="dark"] .ant-select-selector {
  background: #fff !important;
  color: #222 !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .ant-input::placeholder, [data-theme="dark"] .ant-select-selection-placeholder {
  color: #888 !important;
}

/* ========== 内容区卡片和Footer ========== */
.main-content-card, .ant-layout-content > div {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  transition: background 0.3s, color 0.3s;
}
.ant-layout-footer, footer, .ant-pro-global-footer {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  transition: background 0.3s, color 0.3s;
}

/* ========== Content内容区整体背景 ========== */
.ant-layout-content {
  background: var(--bg-color) !important;
  transition: background 0.3s;
}

/* ========== 头像、admin用户名 ========== */
.ant-avatar, .ant-avatar img {
  background: var(--header-bg) !important;
  border: 1px solid var(--border-color) !important;
}
#root .admin-username {
  color: var(--text-color) !important;
  transition: color 0.3s;
}
#root span[style*="color: rgba(0, 0, 0, 0.88)"] {
  color: var(--text-color) !important;
}

/* ========== 主题切换动画层支持动态颜色变量 ========== */
.theme-switch-mask {
  position: fixed;
  z-index: 9999;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background: var(--mask-color, #fff);
  animation: theme-circular-reveal 0.6s cubic-bezier(.4,0,.2,1);
}
@keyframes theme-circular-reveal {
  0% {
    clip-path: circle(0% at 95% 5%);
    opacity: 1;
  }
  80% {
    clip-path: circle(150% at 95% 5%);
    opacity: 1;
  }
  100% {
    clip-path: circle(150% at 95% 5%);
    opacity: 0;
  }
}

@import "tailwindcss";
@custom-variant dark (&:where([data-t=dark], [data-t=dark] *));

/* ========== Breadcrumb面包屑导航 ========== */
.ant-breadcrumb {
  background: var(--table-bg) !important;
  color: var(--text-color) !important;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s;
}
.ant-breadcrumb a {
  color: var(--text-color) !important;
  transition: color 0.3s;
}
.ant-breadcrumb-separator {
  color: var(--text-color) !important;
  opacity: 0.6;
  transition: color 0.3s;
}

/* 优化主卡片和Breadcrumb背景色，提升层次感 */
:root {
  --card-bg-light: #f7f8fa;
  --card-bg-dark: #16213a;
}
[data-theme="dark"] {
  --card-bg: var(--card-bg-dark);
}
[data-theme="light"] {
  --card-bg: var(--card-bg-light);
}
/* 内容区主卡片美化：圆角、阴影、内边距，提升辨识度 */
.main-content-card, .ant-layout-content > div {
  background: var(--card-bg, var(--table-bg)) !important;
  color: var(--text-color) !important;
  border-radius: 16px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
  margin: 32px auto !important;
  padding: 32px 24px !important;
  max-width: 1200px;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

/* 内容区外层去除多余白边 */
.ant-layout-content {
  padding: 0 !important;
  margin: 0 !important;
  background: var(--bg-color) !important;
  transition: background 0.3s;
}

/* 优化表单标签字体颜色和粗细 */
.ant-form-item-label > label, .ant-form-item-label {
  color: var(--form-label-color, var(--text-color)) !important;
  font-weight: 600;
  transition: color 0.3s;
}
[data-theme="dark"] {
  --form-label-color: #fff;
}
[data-theme="light"] {
  --form-label-color: #222;
}

/* 优化分页器统计信息字体 */
.ant-pagination-total-text {
  color: var(--text-color) !important;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

/* 强制修正表单label样式，确保可见性和对比度 */
.ant-form-item-label > label, .ant-form-item-label {
  color: var(--form-label-color, var(--text-color)) !important;
  font-weight: 600;
  transition: color 0.3s;
  opacity: 1 !important;
  background: transparent !important;
}

/* 修正表单label字体颜色，确保随主题切换 */
.ant-form-item-label > label, .ant-form-item-label {
  color: var(--form-label-color, var(--text-color)) !important;
  font-weight: 600;
  transition: color 0.3s;
  opacity: 1 !important;
  background: transparent !important;
}

/* Modal弹框背景色随主题切换，保证label对比度 */
.ant-modal-content {
  background: var(--card-bg, #fff) !important;
  color: var(--text-color) !important;
  transition: background 0.3s, color 0.3s;
}

/* 美化Modal弹框样式 */
.ant-modal-content {
  background: var(--card-bg, #fff) !important;
  color: var(--text-color) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.25) !important;
  padding: 32px 32px 24px 32px !important;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
[data-theme="dark"] .ant-modal-content {
  background: #202940 !important;
  color: #fff !important;
}
.ant-modal .ant-input, .ant-modal .ant-select-selector {
  background: #232b3e !important;
  color: #fff !important;
  border-color: #2c3654 !important;
}
.ant-modal .ant-input::placeholder, .ant-modal .ant-select-selection-placeholder {
  color: #aaa !important;
}
.ant-modal .ant-btn-primary {
  background: #1677ff !important;
  border-color: #1677ff !important;
}
.ant-modal .ant-btn-default {
  background: #fff !important;
  color: #222 !important;
  border-color: #e5e5e5 !important;
}

/* Modal标题区域随主题切换 */
.ant-modal-header {
  background: var(--card-bg, #fff) !important;
  color: var(--text-color) !important;
  border-radius: 16px 16px 0 0 !important;
  border-bottom: none !important;
  transition: background 0.3s, color 0.3s;
}
[data-theme="dark"] .ant-modal-header {
  background: #202940 !important;
  color: #fff !important;
}
.ant-modal-title {
  color: inherit !important;
  font-weight: bold;
}

/* Modal内输入框、下拉框颜色随主题切换 */
.ant-modal .ant-input, .ant-modal .ant-select-selector {
  background: var(--modal-input-bg, #fff) !important;
  color: var(--modal-input-color, #222) !important;
  border-color: #d9d9d9 !important;
  transition: background 0.3s, color 0.3s;
}
[data-theme="dark"] {
  --modal-input-bg: #232b3e;
  --modal-input-color: #fff;
}
[data-theme="light"] {
  --modal-input-bg: #fff;
  --modal-input-color: #222;
}

/* 动画选择下拉框颜色随主题切换 */
[data-theme="dark"] select {
  background: #232b3e !important;
  color: #fff !important;
  border: 1px solid #2c3654 !important;
}
[data-theme="light"] select {
  background: #fff !important;
  color: #222 !important;
  border: 1px solid #d9d9d9 !important;
}
[data-theme="dark"] select option {
  background: #232b3e !important;
  color: #fff !important;
}
[data-theme="light"] select option {
  background: #fff !important;
  color: #222 !important;
}

/* 3D动画展示页美化 */
/* .indextow-select-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 8px 0;
} */
/* .indextow-select-title {
  font-size: 18px;
  font-weight: 500;
  margin-right: 12px;
  color: var(--text-color);
} */
/* .indextow-3d-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 60px 0;
  box-sizing: border-box;
} */
/* .indextow-3d-card {
  width: 900px;
  height: 650px;
  background: var(--card-bg, #fff);
  border-radius: 24px;
  box-shadow: 0 8px 32px #0002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
} */
[data-theme="dark"] .indextow-3d-card {
  background: #202940 !important;
}
[data-theme="light"] .indextow-3d-card {
  background: #fff !important;
}
